//
//  Comment.m
//  Sydeny
//
//  Created by Rainbow on 8/13/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Comment.h"


@implementation Comment
@synthesize commentId;
@synthesize username;
@synthesize timestamp;
@synthesize content;

- (void)encodeWithCoder:(NSCoder *)aCoder
{
	[aCoder encodeObject:self.commentId forKey:@"commentId"];
	[aCoder encodeObject:self.username forKey:@"username"];
	[aCoder encodeObject:self.timestamp forKey:@"timestamp"];
	[aCoder encodeObject:self.content forKey:@"content"];
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
	if ([self init]) {
		self.commentId = [aDecoder decodeObjectForKey:@"commentId"];
		self.username = [aDecoder decodeObjectForKey:@"username"];
		self.timestamp = [aDecoder decodeObjectForKey:@"timestamp"];
		self.content = [aDecoder decodeObjectForKey:@"content"];
    }
	return self;
}

-(void)dealloc
{
    self.commentId = nil;
    self.username = nil;
    self.timestamp = nil;
    self.content = nil;
    [super dealloc];
}

@end
